package com.diudiutechnology.www.yadiudiu.yadiudiu.singlecall.MyActivity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.diudiutechnology.www.yadiudiu.yadiudiu.singlecall.MyAdapter.ResumeCompanyAdapter;
import com.diudiutechnology.www.yadiudiu.yadiudiu.singlecall.MyAdapter.ResumeDetailsActivityAdapter;
import com.diudiutechnology.www.yadiudiu.yadiudiu.singlecall.MyAdapter.ResumeDetailsEducationExperienceAdapter;
import com.diudiutechnology.www.yadiudiu.util.view.ListViewForScrollView;
import com.diudiutechnology.www.yadiudiu.yadiudiu.model.BuyACarFragmentModel;
import com.diudiutechnology.www.yadiudiu.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/8/23.
 * 简历详情
 */

public class ResumeDetailsActivity extends Activity implements View.OnClickListener {
    @Bind(R.id.retur)
    LinearLayout retur;

    @Bind(R.id.gender)//性别
    TextView gender;

    @Bind(R.id.position)//职位
  TextView position;

    @Bind(R.id.scrollView)
    ScrollView scrollView;

    @Bind(R.id.listview)//工作经历
            ListViewForScrollView listview;
    private List<BuyACarFragmentModel> buycarlist;
    ResumeDetailsActivityAdapter adapter;

    @Bind(R.id.education_experience_listview)//教育经历
            ListViewForScrollView education_experience_listview;
    private List<BuyACarFragmentModel> education_experience_listviewlist;
    ResumeDetailsEducationExperienceAdapter education_experience_listviewadapter;

    @Bind(R.id.company_listview)//公司介绍
            ListViewForScrollView company_listview;
    ResumeCompanyAdapter companyAdapter;


    Context context;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_resume_details);
        ButterKnife.bind(this);
        context=this;
        initView();
    }

    private void initView() {
        retur.setOnClickListener(this);
        gender.setText(Html.fromHtml("男<font color='#B3B3B3'>  |  </font>23<font color='#B3B3B3'>  |  </font>未婚<font color='#B3B3B3'>  |  </font>籍贯：遵义"));
        position.setText(Html.fromHtml("销售员<font color='#B3B3B3'>  |  </font>年薪：10万<font color='#B3B3B3'>  |  </font>离职"));

        adapter=new ResumeDetailsActivityAdapter(context);
        listview.setAdapter(adapter);

        education_experience_listviewadapter=new ResumeDetailsEducationExperienceAdapter(context);
        education_experience_listview.setAdapter(education_experience_listviewadapter);

        companyAdapter= new ResumeCompanyAdapter(context);
        company_listview.setAdapter(companyAdapter);
        initData();
        scrollView.scrollTo(0,0);
    }
    //数据
    private void  initData(){
        buycarlist=new ArrayList<>();
            BuyACarFragmentModel model=new BuyACarFragmentModel();
            model.setName("东风标致4S店重庆店");
            model.setStar("2");
            model.setLet("标致508");
            model.setMoney1("29.67");
            model.setMoney2("25.00");
            model.setDistance("2.58");
            model.setDate("20");
            model.setPraise("200");
            buycarlist.add(model);
            model=new BuyACarFragmentModel();
            model.setName("广汽传祺广汽传祺广汽传祺祺");
            model.setStar("3");
            model.setLet("传祺GS8");
            model.setMoney1("26.97");
            model.setMoney2("25.00");
            model.setDistance("3.25");
            model.setDate("1.5万");
            model.setPraise("1.8万");
            buycarlist.add(model);
            adapter.addItem(buycarlist);


        education_experience_listviewlist=new ArrayList<>();
        BuyACarFragmentModel models=new BuyACarFragmentModel();
        models.setName("东风标致4S店重庆店");
        models.setStar("2");
        models.setLet("标致508");
        models.setMoney1("29.67");
        models.setMoney2("25.00");
        models.setDistance("2.58");
        models.setDate("20");
        models.setPraise("200");
        education_experience_listviewlist.add(model);
        models=new BuyACarFragmentModel();
        models.setName("广汽传祺广汽传祺广汽传祺祺");
        models.setStar("3");
        models.setLet("传祺GS8");
        models.setMoney1("26.97");
        models.setMoney2("25.00");
        models.setDistance("3.25");
        models.setDate("1.5万");
        models.setPraise("1.8万");
        education_experience_listviewlist.add(model);
        education_experience_listviewadapter.addItem(education_experience_listviewlist);


        List<BuyACarFragmentModel> listviewlist=new ArrayList<>();
        for (int i=0;i<5;i++){
            BuyACarFragmentModel mode=new BuyACarFragmentModel();
            mode.setName("东风标致4S店重庆店");
            listviewlist.add(mode);
        }
        companyAdapter.addItem(listviewlist);
    }
    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.retur:
                finish();
                break;

        }
    }
}

